<h2>Groups</h2>
<?php
    $this->headTitle('Groups');
    $acl = $this->acl;
?>

<?php if ($acl->isAllowed($this->currentUser, 'access finance pages')): ?>
<a href="<?php echo $this->url(
    array(
        'module' => 'finance',
        'controller' => 'index',
        'action' => 'index',
    ), 'default', true
);?>">Finance</a> |
<?php endif; ?>

<?php if ($acl->isAllowed($this->currentUser, 'access finance pages')): ?>
<a href="<?php echo $this->url(
    array(
        'module' => 'finance',
        'controller' => 'group',
        'action' => 'index',
    ), 'default', true
);?>">Groups</a> |
<?php endif; ?>

<?php if ($acl->isAllowed($this->currentUser, 'access finance pages')): ?>
<a href="<?php echo $this->url(
    array(
        'module' => 'finance',
        'controller' => 'ledger',
        'action' => 'index',
    ), 'default', true
);?>">Ledgers</a>
<?php endif; ?>


<?php if (count($this->paginator)): ?>

<table class="data_table">
    <tr>
        <th>Group<?php echo $this->sortButtons("group"); ?></th>
        <th>Under<?php echo $this->sortButtons("category"); ?></th>
    </tr>
<?php foreach ($this->paginator as $item): ?>
<?php
    $item = $item->toArray();
?>
    <tr>
        <td><?php echo $this->escape($item['name']); ?></td>
        <td><?php echo $this->escape($item['group_category_name']); ?></td>
    </tr>
<?php endforeach; ?>
</table>

<?php endif; ?>

<div class="pagination">
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'search.phtml'); ?>
</div>
<div class="div_clear"></div>


